home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 November
/
PCWorld_2006-11_cd.bin
/
domacnost a kancelar
/
easytime
/
ETT.exe
/
reports
/
xslt
/
DetailedTimesheetGroupByMonth.xsl
< prev
next >
Wrap
Extensible Markup Language
|
2006-08-18
|
3KB
|
91 lines
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"></link>
</head>
<xsl:apply-templates select="/Report/HeaderInfo"></xsl:apply-templates>
<xsl:apply-templates select="/Report/Date"></xsl:apply-templates>
<xsl:apply-templates select="/Report/Total"/>
</html>
</xsl:template>
<!-- Верхний заголовок -->
<xsl:template match="HeaderInfo">
<table class="TableSB" align="center" width="90%">
<tr>
<td>
<table class="TableSB" width="100%" cellpadding="2" cellspacing="0" >
<tr>
<td colspan="2" align="center" class="ReportTitleClass"><xsl:value-of select="/Report/@Type"/></td>
</tr>
<xsl:if test="Date"> <!--Если явно выбран диапазон дат -->
<tr>
<td colspan="2" align="right" class="Date"><xsl:value-of select="Date/From"/> - <xsl:value-of select="Date/To"/></td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="Date">
<table align="center" width="90%">
<tr>
<td class="FromTo" colspan="6"><xsl:value-of select="@From"/> - <xsl:value-of select="@To"/></td>
</tr>
<xsl:if test="position()=1">
<td class="DetailRowTitleClass">Date</td>
<td class="DetailRowTitleClass">Company</td>
<td class="DetailRowTitleClass">Project</td>
<td class="DetailRowTitleClass">Task</td>
<td class="DetailRowTitleClass">Description</td>
<td class="DetailRowTitleClass">Hours</td>
</xsl:if>
<xsl:apply-templates select="Day"/>
<tr>
<td colspan="5" width="60%" valign="top" class="SubTotal">Sub-total:</td>
<td width="40%" valign="top" class="DetailRowDataClass1"><xsl:value-of select="SubTotal"/></td>
</tr>
</table>
</xsl:template>
<xsl:template match="Day">
<tr>
<td width="10%" valign="top" class="DetailRowDataClass"><xsl:value-of select="@Value"/></td>
<td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Company"/></td>
<td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Project"/></td>
<td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Task"/></td>
<td width="30%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Description"/></td>
<td width="10%" valign="top" class="DetailRowDataClass1"><xsl:value-of select="Hours"/></td>
</tr>
</xsl:template>
<xsl:template match="Companies/Company">
<xsl:value-of select="text()"/>
<xsl:if test="following-sibling::*/text()">, </xsl:if>
</xsl:template>
<xsl:template match="Projects/Project">
<xsl:value-of select="text()"/>
<xsl:if test="following-sibling::*/text()">, </xsl:if>
</xsl:template>
<xsl:template match="Tasks/Task">
<xsl:value-of select="text()"/>
<xsl:if test="following-sibling::*/text()">, </xsl:if>
</xsl:template>
<xsl:template match="/Report/Total">
<table align="center" width="90%">
<tr>
<td width="90%" class="Total">Total:</td>
<td class="Total"><xsl:value-of select="text()" /></td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>